package client.gwt;

import com.google.gwt.user.client.ui.impl.RichTextAreaImplIE6;
import com.google.gwt.user.client.DOM;
import client.ConfigHelper;

/**
 * Created by IntelliJ IDEA.
 * User: Wouter Wendelen
 * Date: 4-okt-2007
 * Time: 10:55:21
 */
public class MyRichTextAreaImplIE6 extends RichTextAreaImplIE6 {

    /**
     * add css to editor area
     */

  public void initElement() {
      initElement(ConfigHelper.getCssUrl(DOM.getElementAttribute(getElement(), "title")));
  }

  public native void initElement(String cssUrl) /*-{
    var _this = this;
    window.setTimeout(function() {
      var elem = _this.@com.google.gwt.user.client.ui.impl.RichTextAreaImpl::elem;
      var doc = elem.contentWindow.document;
      doc.write('<html><head><link rel="stylesheet" type="text/css" href="' + cssUrl + '"></head><body CONTENTEDITABLE="true" onContextmenu="return false"></body></html>');

      // Send notification that the iframe has reached design mode.
      _this.@com.google.gwt.user.client.ui.impl.RichTextAreaImplStandard::onElementInitialized()();
    }, 1);

  }-*/;


}

